<%@ page import="org.gnomus.server.C" %>
<%@ page import="org.gnomus.server.Context" %>
<%@ page import="java.util.Map" %>
<jsp:include page="/WEB-INF/jsp/common/_head.jsp"></jsp:include>
<body>
<button id="home" onclick="window.location.href = '/';">Home</button>
<br />
<div class="a-center zoom-150" style="width:640px;margin:0 auto;">
  <form action="/lab" method="post">
    Enter your access code :
    <input name="code" type="text" />
    <input type="submit" />
  </form>
  <hr/>
  or
  <hr/>
  <form action="/lab" method="post">
    Select your access code :
    <%
      for (int i = 0; i < C.codes.length; i++) {
        String[] codes = C.codes[i];
    %>
    <select name="code_<%= i %>">
      <%
        for(String code : codes) {
      %>
      <option><%= code %></option>
      <%
        }
      %>
    </select>
    <%
      }
    %>
    <input type="submit" />
  </form>
  <%
    Map errors = Context.get().errors;
    if (errors.containsKey("code")) {
  %>
  <hr />
  <div style="color:rgba(128,0,0,0.8);font-size:20px;">
    <%= errors.get("code") %>
  </div>
  <%
    }
  %>
</div>
</body>